<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
    <title>业务管理</title>
    <meta name="decorator" content="default"/>
    <link href="${ctxStatic}/layui/css/layui.css" rel="stylesheet" />
    <script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function() {
            $(".check").click(function(){
                var s1 = $(".hui1").val();
                var s2 = $('.hui2').val();
                var s3 =$(this).data("id");
                var parm={};
                parm["id"] = s3;
                parm["dcDay"]=s1;
                parm["dcTime"]=s2;
                $.ajax({
                    type : "POST",  //提交方式
                    url : "${ctx}/sys/business/business/saveDiaocha",//路径
                    data : parm,//数据，这里使用的是Json格式进行传输
                    success : function(data) {//返回数据根据结果进行相应的处理
                        if(data){
                            layer.msg("保存成功",{offset:'150px'},function(){
                                // setTimeout(function () {
                                //     window.location.reload();
                                // },1500)
                                var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                                parent.layer.close(index); //再执行关闭
                                window.parent.location.reload();
                            });
                        }else{
                            layer.msg("保存失败",{offset:'150px'},function() {
                                var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                                parent.layer.close(index); //再执行关闭
                                window.parent.location.reload();
                            });
                        }
                    }
                });
            })
        });
    </script>
</head>
<body>
<%--<sys:message content="${message}"/>--%>
<table id="contentTable" class="table table-striped table-bordered table-condensed">
    <thead>
    <tr>
        <th>报案姓名</th>
        <th>客服姓名</th>
        <th>案件受理时间</th>
        <th>状态</th>
    </tr>
    </thead>
    <tbody>
    <%--<c:forEach items="${business}" var="business">--%>
    <tr>
        <td>
            ${business.memberName}
        </td>
        <td>
            ${business.kfName}
        </td>
        <td>
            <fmt:formatDate value="${business.slTime}" pattern="yyyy-MM-dd"/>
        </td>
        <td>
            ${fns:getDictLabel(business.yjStatic, 'business_static', '')}
        </td>
    </tr>
    <%--</c:forEach>--%>
    </tbody>
</table>

<form class="layui-form" action="##">
    <div class="layui-form-item" pane>
        <label class="layui-form-label">输入调查天数</label>
        <div class="layui-input-inline" >
            <input  name="title" required  lay-verify="required" placeholder="请输入调查天数" autocomplete="off" class="layui-input hui1" >
        </div><span style="color: red">备注：可不填，默认为${defaultTime.dcDay}天</span>
    </div>
    <div  class="layui-inline">
        <label class="layui-form-label">调查开始日期</label>
        <div style="height: 80px;"   class="layui-input-inline">
            <input class="layui-input hui2" id="test1" placeholder="yyyy-MM-dd"><span style="color: red">* 设置调查开始时间，不设置默认为当前日期</span>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn check" type="button" data-id=${business.id}>提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
</form>
<script>
    //Demo
    layui.use('form', function(){
        var form = layui.form;

        //监听提交
        form.on('submit(formDemo)', function(data){

            return false;
        });


    });
    layui.use('laydate', function() {
        var laydate = layui.laydate;

        //常规用法
        laydate.render({
            elem: '#test1'
        });
    });
</script>
</body>
</html>